<template>
  <div class="navMenu">
    <label v-for="(menu, index) in menuList" :key="index">
      <el-menu-item v-if="!menu.children"
                    :data="menu" :index="menu.href" :route="menu.href"
                    disabled="">
        <i :class="menu.icon"></i>
        <span slot="title">{{menu.label}}</span>
      </el-menu-item>

      <el-submenu v-else
                  :data="menu" :index="menu.href" :route="menu.href">
        <template slot="title">
          <i :class="menu.icon"></i>
          <span> {{menu.label}}</span>
        </template>
        <NavMenu :menuList="menu.children"></NavMenu>
      </el-submenu>
    </label>
  </div>
</template>

<script>
export default {
  name: 'NavMenu',
  props: ['menuList'],
  data() {
    return {};
  },
  methods: {}
};
</script>

<style scoped>

</style>
